fix(buffa-codegen): add unused_qualifications to ALLOW_LINTS#102
Merged
fix(buffa-codegen): add unused_qualifications to ALLOW_LINTS#102
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
f4e30f4 to
20713e9
Compare
Cross-proto references within the same package are emitted through the canonical `super::super::__buffa::view::…` (and `…::oneof::…`) path even though the target lives in the same generated module. The bare name would resolve, but the canonical path is stable when a sibling proto defines a same-named natural-path re-export. Workspaces that enable `unused_qualifications = "warn"` and build with `-D warnings` were getting false positives from generated code; the lint is now in the package stitcher's `#[allow(...)]` block alongside `dead_code`, `unused_imports`, etc.
20713e9 to
9e0358b
Compare
rpb-ant
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
unused_qualificationsto theALLOW_LINTSblock emitted on the per-package.mod.rsstitcher.Why
buffa-codegen emits cross-proto references through the canonical
super::super::__buffa::view::…(and…::oneof::…) path even when the target lives in the same generated module — the per-proto split places sibling protos'__view.rsfiles into onepub mod __buffa::view, soChainViewreferencingSignedLinkViewcould just beSignedLinkView. The codegen still uses the canonical path because it is stable when a sibling proto defines a same-named natural-path re-export that would shadow the bare name.unused_qualificationsflags this as a redundant qualification. Workspaces that opt the lint towarnand build with-D warningsget false positives on every cross-proto reference. The qualification is intentional, so the right fix is to suppress the lint at the package-stitcher boundary — the same scope where we already suppressdead_code,unused_imports, and friends.Verification
cargo test -p buffa-codegen --lib: 327 passedcargo test -p buffa-test --lib: 292 passedcargo clippy -p buffa-test -p buffa-codegen --lib -- -D warnings: cleanThe new entry only affects the
#[allow(...)]block on the generatedpub mod __buffa { … }; no runtime behaviour changes.